package com.community.system.service.impl;

import java.util.List;
import com.community.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.community.system.mapper.PatrolRouteMapper;
import com.community.system.domain.PatrolRoute;
import com.community.system.service.IPatrolRouteService;

/**
 * routeService业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class PatrolRouteServiceImpl implements IPatrolRouteService 
{
    @Autowired
    private PatrolRouteMapper patrolRouteMapper;

    /**
     * 查询route
     * 
     * @param routeId route主键
     * @return route
     */
    @Override
    public PatrolRoute selectPatrolRouteByRouteId(Long routeId)
    {
        return patrolRouteMapper.selectPatrolRouteByRouteId(routeId);
    }

    /**
     * 查询route列表
     * 
     * @param patrolRoute route
     * @return route
     */
    @Override
    public List<PatrolRoute> selectPatrolRouteList(PatrolRoute patrolRoute)
    {
        return patrolRouteMapper.selectPatrolRouteList(patrolRoute);
    }

    /**
     * 新增route
     * 
     * @param patrolRoute route
     * @return 结果
     */
    @Override
    public int insertPatrolRoute(PatrolRoute patrolRoute)
    {
        patrolRoute.setCreateTime(DateUtils.getNowDate());
        return patrolRouteMapper.insertPatrolRoute(patrolRoute);
    }

    /**
     * 修改route
     * 
     * @param patrolRoute route
     * @return 结果
     */
    @Override
    public int updatePatrolRoute(PatrolRoute patrolRoute)
    {
        patrolRoute.setUpdateTime(DateUtils.getNowDate());
        return patrolRouteMapper.updatePatrolRoute(patrolRoute);
    }

    /**
     * 批量删除route
     * 
     * @param routeIds 需要删除的route主键
     * @return 结果
     */
    @Override
    public int deletePatrolRouteByRouteIds(Long[] routeIds)
    {
        return patrolRouteMapper.deletePatrolRouteByRouteIds(routeIds);
    }

    /**
     * 删除route信息
     * 
     * @param routeId route主键
     * @return 结果
     */
    @Override
    public int deletePatrolRouteByRouteId(Long routeId)
    {
        return patrolRouteMapper.deletePatrolRouteByRouteId(routeId);
    }
}
